package com.haoyu;

import java.util.ArrayList;
import java.util.List;

public class Main {

    public static void main(String[] args) {
	// write your code here

        String filePath = "D:/Snapshot/input.txt";
        List<String> fileContent = ReadTxt.readTxt(filePath);

        List<Duration> songs = new ArrayList<>();
        int count = 0;
        for (String line:fileContent) {
//            System.out.println(line);
            Duration duration = Engine.parseDuration(line);
            songs.add(duration);
            if (!duration.isEmpty()) {
                count++;
            }
        }

        Duration totalDuration = Engine.add(songs);
        System.out.println("歌曲数量：" + count);
        System.out.println("总长度：" + totalDuration.timeFormat());

    }
}
